package driver

import (
	"log"

	"github.com/elastic/go-elasticsearch/v7"
)

var Elasticsearch *elasticsearch.Client

func InitES() {
	address := []string{"http://47.105.168.36:97"}
	config := elasticsearch.Config{
		Addresses: address,
		Username:  "elastic",
		Password:  "Qq825096218",
	}
	var err error
	Elasticsearch, err = elasticsearch.NewClient(config)
	if err != nil {
		log.Println("Elasticsearch连接失败。。。", err.Error())
	}
}
